package com.huli.controller;
import com.huli.domain.HuliAddress;
import com.huli.service.HuliAddressService;
import com.huli.util.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/hz/address")
public class AddressController {
    @Autowired
    private HuliAddressService huliAddressService;
    //地址管理的地址列表查询

    //地址删除功能
    @RequestMapping("deleteById")
    public Integer deleteById(Integer id){
        Integer integer = huliAddressService.deleteById(id);
        return integer;
    }
    //地址添加功能
    @RequestMapping("save")
    public Result save(HuliAddress huliAddress){
        boolean save = huliAddressService.save(huliAddress);
        return Result.success("添加成功");
    }
    //地址修改功能
    @RequestMapping("updateById")
    public Result updateById(HuliAddress huliAddress){
        boolean updateById = huliAddressService.updateById(huliAddress);
        return Result.success("修改成功");
    }
}
